
define([
  './themes/lang/' + window.YUFP_SYS_CONFIG.language + '/pages/userbench/MyAnnounce.js'
], function (require, exports) {
  // page加载完成后调用ready方法
  exports.ready = function (hashCode, data, cite) {
    yufp.lookup.reg('WF_NODE_STATUS');
    yufp.custom.vue({
      el: '#MyAnnounce',
      data: function () {
        var me = this;
        return {
          urls: {
            dataUrl: backend.echainService + '/api/joinbeanch/getUserAnnounce'
            // 列表数据查询
          },
          WorkListButtons: [
            {label: this.$t('MyAnnounce.cx'),
              op: 'submit',
              type: 'primary',
              icon: 'search',
              show: true,
              click: function (model, valid) {
                if (valid) {
                  model.sessionLoginCode = yufp.session.user.loginCode;
                  var param = {
                    condition: JSON.stringify(model)
                  };
                  me.$refs.WorkListTodoList.remoteData(param);
                }
              }
            },
            {label: this.$t('MyAnnounce.zz'), op: 'reset', type: 'primary', icon: 'yx-loop2', show: this.resetButton }
          ],
          dataParams: {condition: JSON.stringify({sessionLoginCode: yufp.session.user.loginCode})},
          queryFields: [
            {placeholder: this.$t('MyAnnounce.sqlsh'), field: 'bizSeqNo', type: 'input'},
            {placeholder: this.$t('MyAnnounce.khmc'), field: 'custName', type: 'input'}
          ],
          tableColumns: [
            { label: this.$t('MyAnnounce.sqlsh'),
              prop: 'bizSeqNo',
              template: function () {
                return '<template scope="scope">\
                                <a style="text-decoration:underline;cursor:pointer;" @click="_$event(\'custom-click\', scope.row)">{{ scope.row.bizSeqNo }}</a>\
                               </template>';
              }},
            { label: this.$t('MyAnnounce.lcslh'), prop: 'instanceId'},
            { label: this.$t('MyAnnounce.lcbz'), prop: 'wfSign'},
            { label: this.$t('MyAnnounce.khmc'), prop: 'custName' },
            { label: this.$t('MyAnnounce.qyjd'), prop: 'preNodeName' },
            { label: this.$t('MyAnnounce.dqjd'), prop: 'nodeId', hidden: true },
            { label: this.$t('MyAnnounce.dqjd'), prop: 'nodeName' },
            { label: this.$t('MyAnnounce.dqblr'), prop: 'currentNodeUser' },
            { label: this.$t('MyAnnounce.jdzt'), prop: 'nodeStatus', dataCode: 'WF_NODE_STATUS'},
            { label: this.$t('MyAnnounce.jdkssj'), prop: 'nodeStartTime' },
            { label: this.$t('MyAnnounce.lcmc'), prop: 'wfName'}
          ]
        };
      },

      methods: {
        rowDblclick: function (reqData) {
          var action = {
            save: '1',
            submit: '1',
            signin: '1',
            signoff: '1',
            tasksignoff: '1',
            wake: '1',
            callsubflow: '1'
          };
          reqData.action = action;
          reqData.returnBackFuncId = cite.id;
          reqData.returnBackRootId = cite.rootId;
          yufp.router.to('echainInstanceInfo', reqData, cite.rootId);
          // yufp.router.to("logicAndInstanceInfo",reqData,'toDoWorkList');
        },
        rowclick: function (reqData) {

        }
      }
    });
  };

  // 消息处理
  exports.onmessage = function (type, message) {

  };

  // page销毁时触发destroy方法
  exports.destroy = function (id, cite) {

  };
});
